package com.brzjomo.secretiveworld.init;

import java.util.Collections;
import java.util.Set;

import com.google.common.collect.Sets;

import net.minecraft.util.ResourceLocation;
import net.minecraft.world.storage.loot.LootTables;

public class ModLootTables extends LootTables{

	private static final Set<ResourceLocation> LOOT_TABLES = Sets.newHashSet();
	private static final Set<ResourceLocation> READ_ONLY_LOOT_TABLES = Collections.unmodifiableSet(LOOT_TABLES);

	public static final ResourceLocation CORPSES_TEST = register("corpses/test");
	public static final ResourceLocation CORPSES_UNKNOWN_TRAVELER = register("corpses/unknown_traveler");

	private static ResourceLocation register(String id) {
		return register(new ResourceLocation(id));
	}

	private static ResourceLocation register(ResourceLocation id) {
		if (LOOT_TABLES.add(id)) {
			return id;
		} else {
			throw new IllegalArgumentException(id + " is already a registered built-in loot table");
		}
	}
}
